<?php
error_reporting(0);
include ('common/connection.php');
$queryUser="SELECT max(id) as id FROM `users`";
$resultUser=mysql_db_query($db_name,$queryUser);
$rsUser=mysql_fetch_array($resultUser);

$group=$_REQUEST['group'];
$batch=$_REQUEST['batch'];
$gender=$_REQUEST['gender'];
$full_name=$_REQUEST['full_name'];
$nick_name=$_REQUEST['nick_name'];
$cell_phone=$_REQUEST['cell_phone'];
$cell_phone1=$_REQUEST['cell_phone1'];
$email=$_REQUEST['email'];
$address=$_REQUEST['address'];
$amount=$_REQUEST['amount'];
$spouse=$_REQUEST['spouse'];
$spousein=$_REQUEST['spousein'];
$nemail=$_REQUEST['nemail'];
//echo "<pre>";
//print_r($_REQUEST);
function generateRandomNumber($ranLength)
{
	$random_id_length = $ranLength; 
	$rnd_id = uniqid(rand(),1); 
	//$rnd_id = md5(uniqid(rand(), true));
	//$rnd_id = strip_tags(stripslashes($rnd_id)); 
	//$rnd_id = str_replace(".","",$rnd_id); 
	$rnd_id = strrev(str_replace("/","",$rnd_id)); 
	$rnd_id = substr($rnd_id,0,$random_id_length);	
	return $rnd_id;
}
$GenerateOrderId=generateRandomNumber("4");

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="style.css" />
<link rel="stylesheet" href="formStyle.css" type="text/css" />
<link rel="stylesheet" href="tomal_style.css" type="text/css" />

<link rel="stylesheet" href="validationEngine.jquery.css" type="text/css"/>
<script src="jquery-1.6.min.js" type="text/javascript"></script>

<script src="jquery.validationEngine-en.js" type="text/javascript" charset="utf-8"></script>
<script src="jquery.validationEngine.js" type="text/javascript" charset="utf-8"></script>
<script>
	jQuery(document).ready( function() {
		// binds form submission and fields to the validation engine
		jQuery("#formID").validationEngine();
	});
</script>



<script type="text/javascript" src="jquery.countdown.pack.js"></script>
<script type="text/javascript">
function document_valid(num){
//alert(num);

	if(num==1 || num==2){
		document.getElementById("sub_box5").style.display="none";
		document.getElementById("sub_box5_1").style.display="none";
		document.getElementById("sub_box4").style.display="block";
		document.getElementById("sub_box4_1").style.display="block";
	}
	if(num==3){
		document.getElementById("sub_box4").style.display="none";
		document.getElementById("sub_box4_1").style.display="none";
		document.getElementById("sub_box5").style.display="block";
		document.getElementById("sub_box5_1").style.display="block";
	}
	
		
}
</script>

<script type="text/javascript">
$(function () {
$('#countdown').countdown({until:$.countdown.UTCDate(+6, 2012,  3 - 1, 23), format: 'DHMS', layout: 
	  '<div id="timer">' +
		  '<div id="timer_days" class="timer_numbers">{dnn}</div>'+
		  '<div id="timer_hours" class="timer_numbers">{hnn}</div>'+ 
		  '<div id="timer_mins" class="timer_numbers">{mnn}</div>'+
		  '<div id="timer_seconds" class="timer_numbers">{snn}</div>'+
		'<div id="timer_labels">'+
			'<div id="timer_days_label" class="timer_labels">days</div>'+
			'<div id="timer_hours_label" class="timer_labels">hours</div>'+
			'<div id="timer_mins_label" class="timer_labels">mins</div>'+
			'<div id="timer_seconds_label" class="timer_labels">secs</div>'+
		'</div>'+							
	'</div>'
						  
});
});
</script>
<link rel="stylesheet" href="style_countdown.css" type="text/css" />


<title>Home</title>




</head>
<body>
<div id="main_div">
		
	<form  id="formID" class="formular" name="regis" action="preview.php" method="post">
	<div id="main_div_upper_shadow"></div><!-- end of main_div_upper_shadow-->
    <div id="main_div_upper_black"></div><!-- end of main_div_upper_black-->
    
    <div id="main_div_banner_top">
    	<!--<img src="images/banner.jpg" />-->
        
        
    </div><!-- end of main_div_banner_top-->
    <div class="black_search_box"><a href="bobi.php?search=result">Already Registered</a></div>
    <div id="middle_black_body">
    	<p class="countdown_header">Time Left for Reunion Day</p>
        <p class="registration_header">Total Registered</p>
		<?php 
			$origi=$rsUser['id']; 
			$total=(100+$origi);
			if($total<1000){$total="0".$total;}			
		?>
        <div class="total_registered"><img src="images/total_registerd.PNG" /><p><?php echo $total;?></p></div>
    
    	<div id="countdown"></div>
        
          
        
    	<!--<div class="venue1">
        	<p style=" color:#FF4B00; font-weight:bold; margin-bottom:-21px;">Date</p>
            <p style=" color:#FFF; font-weight:bold;">27 January 2012</p>
        </div>
        <div class="venue2">
        	<p style=" color:#FF4B00; font-weight:bold; margin-bottom:-21px;">Venue</p>
            <p style=" color:#FFF; font-weight:bold;">Bangabandhu International Conference Centre</p>
        </div>
        <div class="venue3">
        	<p style=" color:#FF4B00; font-weight:bold; margin-bottom:-21px;">Time</p>
            <p style=" color:#FFF; font-weight:bold;">3pm - 11pm</p>
        </div>-->

    </div><!-- end of middle_black_body -->
    
    <div id="after_middle_black_body">
   		<div id="after_middle_curvy_top"></div>
        <div id="after_middle_normal_body">
			<div id="blinking_info"><p>Banani Bidyaniketan: 40 Years Celebration & Reunion - 2012</p></div><!-- end of blinking_info -->
        	<p class="header_p1" style="margin-bottom:12px;">Online Registration Form</p>
            
            <div class="container">
			
                	<br/>
                     <table cellpadding="0" cellspacing="0" border="0" style="margin-left:30px;">
                    	<tr>
                        	<td width="117px;" valign="top"> Batch </td>
                            <td width="179px;">
								 <select name="batch" id="batch" class="validate[required]">
									<option value="">---</option>
                                    <?php 
										for($i=2012;$i>=1972; $i--){
									?>
                                    	<option value="<?php echo $i;?>" <?php if($batch==$i){?>selected="selected"<?php }?>>
											<?php echo $i;?>
                                        </option>
                                    <?php }?>
								 </select> 
                                 <p class="formText">Please Select</p>
                            </td>
                            
                            
                        	<td width="117px;" valign="top"> Group </td>
                            <td  width="207px;" valign="top"> 
                            	<select name="group" id="group" class="validate[required]">
                                  <option value="">&nbsp;&nbsp;- - -</option>
								  <option value="1"<?php if($group==1){echo "Selected";}?>>Science</option>
								  <option value="2"<?php if($group==2){echo "Selected";}?>>Commerce</option>
								  <option value="3"<?php if($group==3){echo "Selected";}?>>Arts</option>
								</select>
                                <p class="formText">Please Select</p>
                                
                            </td>                           
                         
                            
                            <td width="117px;" valign="top"> Gender </td>
                            <td valign="top"> 
                            	<select <select name="gender" id="gender" class="validate[required]">
								  <option value="">&nbsp;&nbsp;- - -</option>
								  <option value="1"<?php if($_GET['gender']==1){echo "Selected";}?>>Male</option>
								  <option value="2"<?php if($_GET['gender']==2){echo "Selected";}?>>Female</option>
								</select>                                 
                                 <p class="formText">Please Select</p>
                            </td>
                        </tr>
                    </table>
                    <br/><br/>    
                    <table cellpadding="0" cellspacing="0" border="0" style="margin-left:30px;">
                    	<tr>
                            <td valign="top" width="118px;"> Name </td>
                            <td colspan="2" width="300px;" valign="top" height="100px;">
								<input type="text" class="validate[required] text-input textstyle" name="full_name" 
                                id="full_name" size="40" value="<?php echo $_GET['full_name'];?>" />
								<p class="formText">Please Enter Full Name</p>
                            </td>
                                
                            <td valign="top" width="175px"> Nickname </td>
                            <td colspan="2" valign="top"  height="100px;"> 
								<input type="text" name="nick_name" class="text-input textstyle" 
                                id="nick_name" value="<?php echo $_GET['nick_name']?>" /> 
								<p class="formText">Please Enter your nick name.</p>
                            </td>
                        </tr>
                        
                        <tr>
                        	<td valign="top"> Occupation </td>
                            <td colspan="2" valign="top"  height="100px;"> 
								<textarea type="text" name="occupation" id="occupation" 
                                  class="textstyle2" style="width:200px !important;" /> <?php echo $_GET['occupation'];?> </textarea>
								<p class="formText">Occupation Details (eg: Student or Govt. Employee).</p>
                            </td>
                          
                            <td valign="top"> Cell No </td>
                            <td colspan="2" valign="top"  height="100px;">
								<input type="text" name="cell_phone" class="validate[required] text-input textstyle" 
                                id="cell_phone" value="<?php echo $_GET['cell_phone'];?>" />   
								<p class="formText">Please Enter Cell Number.</p>
							</td>                         
                            
                        </tr>         
                        
                        
                        
                        <tr>
                            <td width="77px;" valign="top"> Email </td>
                            <td colspan="2" valign="top">
								<input type="text" name="email" id="email" class="validate[required,custom[email]] text-input textstyle" value="<?php echo $_GET['email'];?>" /> 
								<p class="formText"><?php if($nemail=='7'){?><span style=" color:#FF0000">Sorry this email already exists.</span><?php } else{?>Please Enter Valid E-mail Address.<?php } ?> <br/> Registration Confirmation Will be Sent to This Address</p> 
							</td>
                                
                            <td valign="top"> Confirm mail </td>
                            <td colspan="2" valign="top"> 
								<input class="validate[required,equals[email]] text-input textstyle" type="text" name="conemail" id="conemail" /> 
								<p class="formText">Re-enter The Same e-mail Address.</p>
							</td>
                        </tr>
                        <tr>
                        	<td valign="top"> Spouse Name </td>
                            <td colspan="2" valign="top"  height="100px;"> 
								<input type="text" name="spouse" id="spouse" 
                                value="<?php echo $spouse;?>"  class="textstyle" />  
								<p class="formText">Please Enter Your Spouse Name.if not make  it blank</p>
                            </td>
                            
                            <td valign="top"> Spouse Included </td>
                            <td colspan="2" valign="top"  height="100px;">
								<select name="spousein">                                	
                                    <option value="1" <?php if($spousein==1){?> selected="selected"<?php }?>>Yes</option>
                                	<option value="2" selected="selected">No</option>
                                </select>   
								<p class="formText">Please Select.</p>
							</td>                         
                            
                        </tr> 
                        <tr>
                        	<td valign="top"> Kids Included </td>
                            <td colspan="2" valign="top"  height="100px;"> 
								<select name="kids">                                	
                                    <option value="0">None</option>
                                    <?php 
										for($j=1;$j<=6;$j++){
									?>
                                    	<option value="<?php echo $j;?>"><?php echo $j;?></option>
                                    <?php }?>
                                	
                                </select>   
								<p class="formText">Please Enter Kids Number.<br /> you want to bring them in reunion program</p>
                            </td>
                            
                            <td valign="top">  </td>
                            <td colspan="2" valign="top"  height="100px;">
								
							</td>                         
                            
                        </tr>                   
                    </table>
					<table style="margin-bottom:40px; margin-left:26px; margin-top:18px;">
						<tr>
                            <td valign="top" width="115px;;"> Postal <br/>Address </td>
                            <td colspan="2">
								<textarea name="address" id="address" class="validate[required] text-input textstyle2" style="resize:none;"><?php echo $_GET['address'];?></textarea>
							    <p class="formText">Please Enter Postal Address.</p> 
							</td>  
                        </tr>                        
					</table>
                    
            </div><!-- end of container -->
            
            <br />
            <br />
			
            <div class="box4">
                <br />
                <div class="sub_box6">
					<?php echo $GenerateOrderId;?>
					<input type="hidden" name="uid" id="uid" value="<?php echo $GenerateOrderId;?>" />
				</div><br />
                <div class="p_box_3"><p>Please Enter The Numbers Shown Above in the following Box.</p></div>
					<input type="text" class="validate[required,equals[uid]] text-input textstyle" name="id_no" id="id_no" style="height:30px;" /><br /><br />
                    <input type="submit" value="Submit" class="oxava"/>
                <br />
            </div>	
            
            
            
        
        </div>
        <div id="after_middle_curvy_bottom"></div>
    </div><!-- end of after_middle_black_body -->
    </form>
</div><!-- end of main_div -->


<div class="webpers_logo">
	<p class="copy_right">&copy; 2012, all right reserverd to <a href="https://www.webpers.com" style="color:#0066FF; font-weight:bold;">2008 Batch</a></p>
    <div class="left_static_1">
        
        <ul>
        	<li><p class="powered_by">Powered By <a href="http://www.webpers.com" style="color:#0066FF; font-weight:bold;"> webpers.com </a></p></li>
            <li><a href="http://www.webpers.com" style="overflow:hidden"><div class="webpers"></div></a></li>
            <li><a href="https://www.facebook.com/pages/Webpers/245892612091499" style="overflow:hidden"><div class="webpers_facebook"></div></a></li>
            <li><a href="#" style="overflow:hidden"><div class="webpers_twitter"></div></a></li>
        </ul>
        
        
        
    </div>
</div>


<script type="text/javascript" />
function blink(selector){
$(selector).fadeOut(500, function(){
    $(this).fadeIn(500, function(){
        blink(this);
    });
});
}



blink('#blink_2');
blink('#blinking_info');


</script>

<script type="text/javascript">
	getBatch(<?php echo $group;?>,<?php echo $batch;?>);
	getBatch(<?php echo $group;?>,<?php echo $batch;?>);
	document_valid(<?php echo $amount;?>);
	//alert('fgdg');
</script>


</body>
</html>
